//
//  Scrollview-BackGroundColor.swift
//  HoneyKeyboard
//
//  Created by Wade on 2025/1/21.
//

import Foundation
import UIKit
extension UIView {
    func setGradientBackground(colorOne: UIColor, colorTwo: UIColor,colorThree: UIColor) {
        let gradientLayer = CAGradientLayer()
        gradientLayer.frame = bounds
        gradientLayer.colors = [colorOne.cgColor, colorTwo.cgColor,colorThree.cgColor]
        gradientLayer.locations = [0.0,0.2,0.6]
        gradientLayer.startPoint = CGPoint(x: 0.5, y: 0.0)
        gradientLayer.endPoint = CGPoint(x: 0.5, y: 1.0)
        
        layer.insertSublayer(gradientLayer, at: 0)
    }
}
